<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <%@include file="../common/common.jsp" %>
<!--     <script type="text/javascript" src="<%=basePath %>js/bootstrap-typeahead.js"></script> -->
    <script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
	<style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
		.err{border: solid 1px red;}

    </style>
  </head>
  
  <body>
  <input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="[&quot;Alabama&quot;,&quot;Alaska&quot;,&quot;Arizona&quot;,&quot;Arkansas&quot;,&quot;California&quot;,&quot;Colorado&quot;,&quot;Connecticut&quot;,&quot;Delaware&quot;,&quot;Florida&quot;,&quot;Georgia&quot;,&quot;Hawaii&quot;,&quot;Idaho&quot;,&quot;Illinois&quot;,&quot;Indiana&quot;,&quot;Iowa&quot;,&quot;Kansas&quot;,&quot;Kentucky&quot;,&quot;Louisiana&quot;,&quot;Maine&quot;,&quot;Maryland&quot;,&quot;Massachusetts&quot;,&quot;Michigan&quot;,&quot;Minnesota&quot;,&quot;Mississippi&quot;,&quot;Missouri&quot;,&quot;Montana&quot;,&quot;Nebraska&quot;,&quot;Nevada&quot;,&quot;New Hampshire&quot;,&quot;New Jersey&quot;,&quot;New Mexico&quot;,&quot;New York&quot;,&quot;North Dakota&quot;,&quot;North Carolina&quot;,&quot;Ohio&quot;,&quot;Oklahoma&quot;,&quot;Oregon&quot;,&quot;Pennsylvania&quot;,&quot;Rhode Island&quot;,&quot;South Carolina&quot;,&quot;South Dakota&quot;,&quot;Tennessee&quot;,&quot;Texas&quot;,&quot;Utah&quot;,&quot;Vermont&quot;,&quot;Virginia&quot;,&quot;Washington&quot;,&quot;West Virginia&quot;,&quot;Wisconsin&quot;,&quot;Wyoming&quot;]">
  
    <form id="frm" action="user/saveUser.do" method="post" class="definewidth m20">
		<input type="hidden" name="action" value="${param.action }" />
		<input type="hidden" name="id" value="${param.id }" />
	    <table class="table table-bordered table-hover definewidth m10">
	        <tr>
	            <td width="14%" class="tableleft">学号</td>
	            <td><input type="text" name="stu_no" id="stu_no" value="${info.stu_no}" data-required="true" class="err"/></td>
	        </tr>
	        <tr>
	            <td class="tableleft">姓名</td>
	            <td><input type="text" name="stu_name" id="stu_name" value="${info.stu_name }" data-required="true"/></td>
	        </tr>
	        <tr>
	            <td class="tableleft">生日</td>
	            <td><input type="birthday" name="birthday" value="${info.birthday }" class="Wdate" data-required="true" onclick="WdatePicker({startDate:'1990-01-01'})"/></td>
	        </tr>
	        <tr>
	            <td class="tableleft">性别</td>
	            <td>
	                <input type="radio" name="gender" value="0"
	                    <c:if test="${info.gender eq 0 or empty info.gender}"> checked </c:if> /> 男
	              	<input type="radio" name="gender" value="1"
	                    <c:if test="${info.gender eq 1}"> checked </c:if> /> 女
	            </td>
	        </tr>
	        
	        <tr>
	            <td class="tableleft"></td>
	            <td>
	                <button type="button" onclick="save()" class="btn btn-primary" type="button">保存</button>				 &nbsp;&nbsp;
	                <button type="button" class="btn" onclick="frameElement.api.close();">关闭</button>
	            </td>
	        </tr>
	    </table>
	</form>
  </body>
</html>
<script type="text/javascript">
	function save() {
		var str = $('#frm').serialize();
		$.post("stu/saveStu.do", str, function(a, b) {
			if (b == 'success') {
				var msg = a.msg;
				alert(msg)
				if (msg == '保存成功') {
					window.location.href = "stu/queryStu.do";
				}
			}
		});
	}
</script>